<template>
  <div class="person">
    <h2>人员信息</h2>
    <h4>姓名：{{pname}}</h4>
    <h4>年龄：{{age}}</h4>
    <button @click="showPerson">查看人员信息</button>
  </div>
</template>

<script>
  export default {
    name:'Person',
    data(){
      return {
        pname:'强哥',
        age:18
      }
    },
    methods:{
      showPerson(){
        alert(`我叫${this.sname}今年刚满${this.age}岁`)
      }
    }
  }
</script>

<style>
  .person {
    background-color: orange;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 0 10px;
  }
</style>